pub fn in_range(f: f32, start: f32, end: f32) -> bool {
    return f == f.clamp(start.min(end), start.max(end));
}

pub fn intersects(range1: (f32, f32), range2: (f32, f32)) -> bool {
    in_range(range1.0, range2.0, range2.1)
        || in_range(range1.1, range2.0, range2.1)
        || in_range(range2.0, range1.0, range1.1)
        || in_range(range2.1, range1.0, range1.1)
}
